import request from '@/config/axios'

// 文章标签 VO
export interface ArticleTagVO {
  id: number // 编号
  tagId: number // 标签编号
  articleId: number // 文章编号
  articleName: string // 文章编号
  tagName: string // 文章编号
}

// 文章标签 API
export const ArticleTagApi = {
  // 查询文章标签分页
  getArticleTagPage: async (params: any) => {
    return await request.get({ url: `/blog/article-tag/page`, params })
  },

  // 查询文章标签详情
  getArticleTag: async (id: number) => {
    return await request.get({ url: `/blog/article-tag/get?id=` + id })
  },

  // 新增文章标签
  createArticleTag: async (data: ArticleTagVO) => {
    return await request.post({ url: `/blog/article-tag/create`, data })
  },

  // 修改文章标签
  updateArticleTag: async (data: ArticleTagVO) => {
    return await request.put({ url: `/blog/article-tag/update`, data })
  },

  // 删除文章标签
  deleteArticleTag: async (id: number) => {
    return await request.delete({ url: `/blog/article-tag/delete?id=` + id })
  },

  // 导出文章标签 Excel
  exportArticleTag: async (params) => {
    return await request.download({ url: `/blog/article-tag/export-excel`, params })
  },
}
